import { Button } from 'antd'
import { FC } from 'react'
import './NavHeader.scss'
import { TNav } from '@type'

type TRenderNav<T> = {
  category: string
  navInfo: T[]
}
const NavHeader: FC<{ navItem: TRenderNav<TNav>[]; openModal: Function }> = ({ navItem, openModal }) => {
  return (
    <div className="nav-header">
      {navItem.map((item, index) => (
        <Button key={index} type="link" size={'small'}>
          {item.category}
        </Button>
      ))}
      <Button style={{ marginLeft: '16px' }} onClick={() => openModal()} type={'primary'}>
        添加分类
      </Button>
    </div>
  )
}
export default NavHeader
